<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}" media="all">
</head>
<body class="layui-layout-body">
<div class="layui-container" style="width: 960px;height: 600px;margin-top: 0px;padding-top: 60px;">

    <table class="layui-hide" id="test" lay-filter="test"></table>
    <script th:src="@{/layui/layui.js}" charset="utf-8"></script>
    <script th:src="@{/layui/layui.all.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/js/jquery-3.4.1.js}"></script>
    <script>
        layui.use('table', function(){
            var table = layui.table;
            var token = layui.data('token').data;
            table.render({
                elem: '#test'
                ,url:'/order/findByOrderId/1'
                ,title: '订单列表'
                ,headers : {'token': token }
                ,cols: [
                    [
                        {field:'id', width:80, title: '编号', sort: true}
                        , {field: 'serial_number', width: 160, title: '序号' }
                        , {field: 'productId', width: 100, title: '商品ID' }
                        , {field:'number', width:100, title: '数量' }
                        , {field:'price', width:100, title: '单价'}

                    ]
                ]
                ,page: true
            });

        });
    </script>

</div>
<script>
    //二级菜单联动
    layui.use('element', function(){
        var element = layui.element;

    });
</script>
</body>
</html>